package com.towexin.application.activiti.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

/**
 * TODO
 *
 * @author Towexin
 * @version 1.0
 * @date 2021/10/20 10:56
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_approve_info")
public class ApproveInfo implements Serializable {
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String processInstanceId;

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private Integer state;              // 审核状态  0=发起；1=执行中；2=同意；3=不同意；4=结束

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String userOrRole;          // 处理的用户或角色

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private String remark;              // 审核备注

    @TableField(insertStrategy = FieldStrategy.NOT_NULL)
    private Date processingTime;        // 处理时间

    @TableField
    private Long timestamp;

    @TableField(exist = false)
    private String assignee;

    public ApproveInfo processInstanceId(String processInstanceId){
        this.processInstanceId = processInstanceId;
        return this;
    }
    public ApproveInfo state(Integer state){
        this.state = state;
        return this;
    }
    public ApproveInfo userOrRole(String userOrRole){
        this.userOrRole = userOrRole;
        return this;
    }
    public ApproveInfo remark(String remark){
        this.remark = remark;
        return this;
    }
    public ApproveInfo processingTime(Date processingTime){
        this.processingTime = processingTime;
        return this;
    }
    public ApproveInfo timestamp(Long timestamp){
        this.timestamp = timestamp;
        return this;
    }

}
